#!/bin/bash

exec 2>&1

if [ -z "${SS_MODULE}" ]; then
    echo "Warning: SS_MODULE is empty, default to ss-server!"
    SS_MODULE="ss-server"
fi

if [ -n "${SS_CONFIG}" ]; then
    echo "starting shadowsocks..."
    exec chpst -u shadowsocks ${SS_MODULE} ${SS_CONFIG}
else
    echo "Error: SS_CONFIG is empty, exit!"
    exit 1
fi
